#ifndef __W25Q64_H
#define __W25Q64_H

#include "../../imx6ul/imx6ul.h"
#include "../spi/bsp_spi.h"
#include "W25Q64_Ins.h"

#define MySPI_Start() SPI_Start(ECSPI3)
#define MySPI_SwapByte(x) SPI_SwapByte(ECSPI3, x)
#define MySPI_Stop() SPI_Stop(ECSPI3)
#define MySPI_Init() SPI_Init(ECSPI3)

void W25Q64_Init(void);
void W25Q64_ReadID(uint8_t *MID, uint16_t *DID);
void W25Q64_PageProgram(uint32_t Address, uint8_t *DataArray, uint16_t Count);
void W25Q64_SectorErase(uint32_t Address);
void W25Q64_ReadData(uint32_t Address, uint8_t *DataArray, uint32_t Count);
void SPI_W_SS(uint8_t BitValue);

#endif
